<template>
    <div>
        <div v-if="Loading">
            加载中......
        </div>
        <div v-else>
            <div v-if="error.statusCode===404">页面不存在404</div>
            <div v-if="error.statusCode===500">错误500</div>
            <a-button @click="Change">返回首页</a-button>
        </div>
    </div>
</template>
<script lang='ts'>
    import {Component, Vue, Prop} from "vue-property-decorator";

    @Component({
        layout: 'other',
    })
    export default class Error extends Vue {
        @Prop({type: Object, default: null}) error!: Object;
        Loading: boolean = true;

        Change() {
            this.$router.push('/');
        }

        created() {
            const _this = this;
            setTimeout(() => {
                _this.Loading = false;
            }, 1500);
            console.log(this.error);
        }
    }
</script>
